package state.socket;

import state.GameForm;

public class Flow extends GameForm implements DataReceiveListener {
  private int flowHeader;
  
  public Flow(int flowHeader) {
    this.flowHeader = flowHeader;
  }
  
  public final DataPackage createPackage(int header) {
    DataPackage dataPackage = new DataPackage(flowHeader);
    dataPackage.putString("header");
    dataPackage.putInt(MapDataPackage.INT_TYPE);
    dataPackage.putInt(header);
    return dataPackage;
  }
  
  public final DataPackage createPackage(int header, int size) {
    DataPackage dataPackage = new DataPackage(flowHeader, size);
    dataPackage.putString("header");
    dataPackage.putInt(MapDataPackage.INT_TYPE);
    dataPackage.putInt(header);
    return dataPackage;
  }
  
  public final MapDataPackage createMapPackage(int header){
	  return MapDataPackage.getMapPackage(createPackage(header));
  }
  
  public final MapDataPackage createMapPackage(int header, int size){
	  return MapDataPackage.getMapPackage(createPackage(header, size));
  }

  public void onConnectDone() {
  }

  public void onConnectFail() {
  }

  public void onDisconnect() {
  }

  public void onRecieveData(DataPackage dataPackage) {
  }  
}
